/******************************************************************************
 * (C) Copyright 2013 Atech-Automotive
 * FILE NAME:    hwa_e2_cfg.h
 * DESCRIPTION:
 * 
 * DATE BEGUN:   2014/08/06
 * BY:                         
 * PRODUCT NAME:
 * APPLICATION:
 * TARGET H/W:
 * DOC REF:
 *****************************************************************************
 */

#ifndef hwa_e2_cfg_h
#define hwa_e2_cfg_h

/* includes */ 
#include "system.h"

/* defines */

/*****************************************************************************/
/**
* Function Name: MCU_E2PROM_TYPE
* Description: mcu select. 
*
* Param:   0: MCU_E2PROM_S12G48   0x000~0x5FF, backup start addr: 0x300
*          1: MCU_E2PROM_S12G64   0x000~0x7FF, backup start addr: 0x400
*          2: MCU_E2PROM_S12G128  0x000~0xFFF, backup start addr: 0x800
*          3: MCU_E2PROM_S12G192  0x000~0xFFF, backup start addr: 0x800
*
* Author:  
******************************************************************************/
#define MCU_E2PROM_S12G48        (0U) /* 0x400~0x9FF, 1.5K */
#define MCU_E2PROM_S12G64        (1U) /* 0x400~0x0BFF, 2 K */
#define MCU_E2PROM_S12G128       (2U) /* 0x400~0x13FF, 4 K */
#define MCU_E2PROM_S12G192       (3U) /* 0x400~0x13FF, 4 K */


#define MCU_E2PROM_TYPE    MCU_E2PROM_S12G48


/*****************************************************************************/
/**
* Function Name: NUM_OF_E2_ID
* Description:  number of ee id 
*
* Param:   
*          
* Author:  
******************************************************************************/
#define NUM_OF_E2_32_ID    (32U)
#define NUM_OF_E2_64_ID    (64U)


#define NUM_OF_E2_ID       NUM_OF_E2_32_ID

/*****************************************************************************/
/**
* Function Name: EE ID define 
* Description:  
*
* Param:   
*          
* Author:  
******************************************************************************/
#define E2_DATA0_ID		   ((UINT8)0)
#define E2_DATA1_ID		   ((UINT8)1)
#define E2_DATA2_ID		   ((UINT8)2)
#define E2_DATA3_ID	       ((UINT8)3)
#define E2_DATA4_ID		   ((UINT8)4)
#define E2_DATA5_ID		   ((UINT8)5)
#define E2_DATA6_ID		   ((UINT8)6)
#define E2_DATA7_ID		   ((UINT8)7)
#define E2_DATA8_ID		   ((UINT8)8)
#define E2_DATA9_ID	   	   ((UINT8)9)  
#define E2_DATA10_ID	   ((UINT8)10)
#define E2_DATA11_ID	   ((UINT8)11)  
#define E2_DATA12_ID	   ((UINT8)12)
#define E2_DATA13_ID	   ((UINT8)13)  
#define E2_DATA14_ID	   ((UINT8)14)  
#define E2_DATA15_ID	   ((UINT8)15)
#define E2_DATA16_ID	   ((UINT8)16)  
#define E2_DATA17_ID	   ((UINT8)17)
#define E2_DATA18_ID	   ((UINT8)18)  
#define E2_DATA19_ID	   ((UINT8)19)
#define E2_DATA20_ID	   ((UINT8)20)
#define E2_DATA21_ID	   ((UINT8)21)  
#define E2_DATA22_ID	   ((UINT8)22)
#define E2_DATA23_ID	   ((UINT8)23)  
#define E2_DATA24_ID	   ((UINT8)24)  
#define E2_DATA25_ID	   ((UINT8)25)
#define E2_DATA26_ID	   ((UINT8)26)  
#define E2_DATA27_ID	   ((UINT8)27)
#define E2_DATA28_ID	   ((UINT8)28)  
#define E2_DATA29_ID	   ((UINT8)29) 
#define E2_DATA30_ID	   ((UINT8)30)
#define E2_DATA31_ID	   ((UINT8)31)

#if (NUM_OF_E2_ID == NUM_OF_E2_64_ID)

#define E2_DATA32_ID	   ((UINT8)32)
#define E2_DATA33_ID	   ((UINT8)33)
#define E2_DATA34_ID	   ((UINT8)34)
#define E2_DATA35_ID	   ((UINT8)35)
#define E2_DATA36_ID	   ((UINT8)36)
#define E2_DATA37_ID	   ((UINT8)37)
#define E2_DATA38_ID	   ((UINT8)38)
#define E2_DATA39_ID	   ((UINT8)39)
#define E2_DATA40_ID	   ((UINT8)40)
#define E2_DATA41_ID	   ((UINT8)41)  
#define E2_DATA42_ID	   ((UINT8)42)
#define E2_DATA43_ID	   ((UINT8)43)  
#define E2_DATA44_ID	   ((UINT8)44)
#define E2_DATA45_ID	   ((UINT8)45)  
#define E2_DATA46_ID	   ((UINT8)46)  
#define E2_DATA47_ID	   ((UINT8)47)
#define E2_DATA48_ID	   ((UINT8)48)  
#define E2_DATA49_ID	   ((UINT8)49)
#define E2_DATA50_ID	   ((UINT8)50)  
#define E2_DATA51_ID	   ((UINT8)51)
#define E2_DATA52_ID	   ((UINT8)52)
#define E2_DATA53_ID	   ((UINT8)53)  
#define E2_DATA54_ID	   ((UINT8)54)
#define E2_DATA55_ID	   ((UINT8)55)  
#define E2_DATA56_ID	   ((UINT8)56)  
#define E2_DATA57_ID	   ((UINT8)57)
#define E2_DATA58_ID	   ((UINT8)58)  
#define E2_DATA59_ID	   ((UINT8)59)
#define E2_DATA60_ID	   ((UINT8)60)  
#define E2_DATA61_ID	   ((UINT8)61) 
#define E2_DATA62_ID	   ((UINT8)62)
#define E2_DATA63_ID	   ((UINT8)63)

#endif//#if (NUM_OF_E2_ID == NUM_OF_E2_64_ID)

/*****************************************************************************/
/**
* Function Name: EE data address 
* Description:  
*
* Param:   
*          
* Author:  
******************************************************************************/
#define E2_DATA0_ADDR		((UINT16)0x0000)
#define E2_DATA1_ADDR		((UINT16)0x0008)
#define E2_DATA2_ADDR		((UINT16)0x0010)
#define E2_DATA3_ADDR	   	((UINT16)0x0018)
#define E2_DATA4_ADDR		((UINT16)0x0020)
#define E2_DATA5_ADDR		((UINT16)0x0028)
#define E2_DATA6_ADDR		((UINT16)0x0030)
#define E2_DATA7_ADDR		((UINT16)0x0038)
#define E2_DATA8_ADDR		((UINT16)0x0040)
#define E2_DATA9_ADDR	 	((UINT16)0x0048)
#define E2_DATA10_ADDR	 	((UINT16)0x0050)
#define E2_DATA11_ADDR	 	((UINT16)0x0058)
#define E2_DATA12_ADDR	 	((UINT16)0x0060)
#define E2_DATA13_ADDR	 	((UINT16)0x0068)
#define E2_DATA14_ADDR	 	((UINT16)0x0070)
#define E2_DATA15_ADDR	 	((UINT16)0x0078)
#define E2_DATA16_ADDR	 	((UINT16)0x0080)
#define E2_DATA17_ADDR	 	((UINT16)0x0088)
#define E2_DATA18_ADDR	 	((UINT16)0x0090)
#define E2_DATA19_ADDR	 	((UINT16)0x0098)
#define E2_DATA20_ADDR	 	((UINT16)0x00A0)
#define E2_DATA21_ADDR	 	((UINT16)0x00A8)
#define E2_DATA22_ADDR	 	((UINT16)0x00B0)
#define E2_DATA23_ADDR	 	((UINT16)0x00B8)
#define E2_DATA24_ADDR	 	((UINT16)0x00C0)
#define E2_DATA25_ADDR	 	((UINT16)0x00C8)
#define E2_DATA26_ADDR	 	((UINT16)0x00D0)
#define E2_DATA27_ADDR	 	((UINT16)0x00D8)
#define E2_DATA28_ADDR	 	((UINT16)0x00E0)
#define E2_DATA29_ADDR	 	((UINT16)0x00E8)
#define E2_DATA30_ADDR	 	((UINT16)0x00F0)
#define E2_DATA31_ADDR	 	((UINT16)0x00F8)

#if (NUM_OF_E2_ID == NUM_OF_E2_64_ID)

#define E2_DATA32_ADDR		((UINT16)0x0100)
#define E2_DATA33_ADDR		((UINT16)0x0108)
#define E2_DATA34_ADDR		((UINT16)0x0110)
#define E2_DATA35_ADDR	   	((UINT16)0x0118)
#define E2_DATA36_ADDR		((UINT16)0x0120)
#define E2_DATA37_ADDR		((UINT16)0x0128)
#define E2_DATA38_ADDR		((UINT16)0x0130)
#define E2_DATA39_ADDR		((UINT16)0x0138)
#define E2_DATA40_ADDR		((UINT16)0x0140)
#define E2_DATA41_ADDR	 	((UINT16)0x0148)
#define E2_DATA42_ADDR	 	((UINT16)0x0150)
#define E2_DATA43_ADDR	 	((UINT16)0x0158)
#define E2_DATA44_ADDR	 	((UINT16)0x0160)
#define E2_DATA45_ADDR	 	((UINT16)0x0168)
#define E2_DATA46_ADDR	 	((UINT16)0x0170)
#define E2_DATA47_ADDR	 	((UINT16)0x0178)
#define E2_DATA48_ADDR	 	((UINT16)0x0180)
#define E2_DATA49_ADDR	 	((UINT16)0x0188)
#define E2_DATA50_ADDR	 	((UINT16)0x0190)
#define E2_DATA51_ADDR	 	((UINT16)0x0198)
#define E2_DATA52_ADDR	 	((UINT16)0x01A0)
#define E2_DATA53_ADDR	 	((UINT16)0x01A8)
#define E2_DATA54_ADDR	 	((UINT16)0x01B0)
#define E2_DATA55_ADDR	 	((UINT16)0x01B8)
#define E2_DATA56_ADDR	 	((UINT16)0x01C0)
#define E2_DATA57_ADDR	 	((UINT16)0x01C8)
#define E2_DATA58_ADDR	 	((UINT16)0x01D0)
#define E2_DATA59_ADDR	 	((UINT16)0x01D8)
#define E2_DATA60_ADDR	 	((UINT16)0x01E0)
#define E2_DATA61_ADDR	 	((UINT16)0x01E8)
#define E2_DATA62_ADDR	 	((UINT16)0x01F0)
#define E2_DATA63_ADDR	 	((UINT16)0x01F8)

#endif //#if (NUM_OF_E2_ID == NUM_OF_E2_64_ID)

/*****************************************************************************/
/**
* Function Name: EE data length
* Description:  
*
* Param:   
*          
* Author:  
******************************************************************************/
#define E2_DATA_LENGTH    ((UINT8)8)

/*****************************************************************************/
/**
* Function Name: EE_MAP_TABLE
* Description: address and length of ee map. 
*
* Param:   
*          
* Author:  
******************************************************************************/

#if (NUM_OF_E2_ID == NUM_OF_E2_32_ID)
#define EE_MAP_TABLE    \
    {E2_DATA0_ADDR    },\
    {E2_DATA1_ADDR    },\
    {E2_DATA2_ADDR    },\
    {E2_DATA3_ADDR    },\
    {E2_DATA4_ADDR    },\
    {E2_DATA5_ADDR    },\
    {E2_DATA6_ADDR    },\
    {E2_DATA7_ADDR    },\
    {E2_DATA8_ADDR    },\
    {E2_DATA9_ADDR    },\
    {E2_DATA10_ADDR   },\
    {E2_DATA11_ADDR   },\
    {E2_DATA12_ADDR   },\
    {E2_DATA13_ADDR   },\
    {E2_DATA14_ADDR   },\
    {E2_DATA15_ADDR   },\
    {E2_DATA16_ADDR   },\
    {E2_DATA17_ADDR   },\
    {E2_DATA18_ADDR   },\
    {E2_DATA19_ADDR   },\
    {E2_DATA20_ADDR   },\
    {E2_DATA21_ADDR   },\
    {E2_DATA22_ADDR   },\
    {E2_DATA23_ADDR   },\
    {E2_DATA24_ADDR   },\
    {E2_DATA25_ADDR   },\
    {E2_DATA26_ADDR   },\
    {E2_DATA27_ADDR   },\
    {E2_DATA28_ADDR   },\
    {E2_DATA29_ADDR   },\
    {E2_DATA30_ADDR   },\
    {E2_DATA31_ADDR   },

#elif (NUM_OF_E2_ID == NUM_OF_E2_64_ID)   

#define EE_MAP_TABLE    \
    {E2_DATA0_ADDR    },\
    {E2_DATA1_ADDR    },\
    {E2_DATA2_ADDR    },\
    {E2_DATA3_ADDR    },\
    {E2_DATA4_ADDR    },\
    {E2_DATA5_ADDR    },\
    {E2_DATA6_ADDR    },\
    {E2_DATA7_ADDR    },\
    {E2_DATA8_ADDR    },\
    {E2_DATA9_ADDR    },\
    {E2_DATA10_ADDR   },\
    {E2_DATA11_ADDR   },\
    {E2_DATA12_ADDR   },\
    {E2_DATA13_ADDR   },\
    {E2_DATA14_ADDR   },\
    {E2_DATA15_ADDR   },\
    {E2_DATA16_ADDR   },\
    {E2_DATA17_ADDR   },\
    {E2_DATA18_ADDR   },\
    {E2_DATA19_ADDR   },\
    {E2_DATA20_ADDR   },\
    {E2_DATA21_ADDR   },\
    {E2_DATA22_ADDR   },\
    {E2_DATA23_ADDR   },\
    {E2_DATA24_ADDR   },\
    {E2_DATA25_ADDR   },\
    {E2_DATA26_ADDR   },\
    {E2_DATA27_ADDR   },\
    {E2_DATA28_ADDR   },\
    {E2_DATA29_ADDR   },\
    {E2_DATA30_ADDR   },\
    {E2_DATA31_ADDR   },\
    {E2_DATA32_ADDR   },\
    {E2_DATA33_ADDR   },\
	{E2_DATA34_ADDR   },\
	{E2_DATA35_ADDR   },\
	{E2_DATA36_ADDR   },\
	{E2_DATA37_ADDR   },\
	{E2_DATA38_ADDR   },\
	{E2_DATA39_ADDR   },\
	{E2_DATA40_ADDR   },\
	{E2_DATA41_ADDR   },\
	{E2_DATA42_ADDR   },\
	{E2_DATA43_ADDR   },\
	{E2_DATA44_ADDR   },\
	{E2_DATA45_ADDR   },\
	{E2_DATA46_ADDR   },\
	{E2_DATA47_ADDR   },\
	{E2_DATA48_ADDR   },\
	{E2_DATA49_ADDR   },\
	{E2_DATA50_ADDR   },\
	{E2_DATA51_ADDR   },\
	{E2_DATA52_ADDR   },\
	{E2_DATA53_ADDR   },\
	{E2_DATA54_ADDR   },\
	{E2_DATA55_ADDR   },\
	{E2_DATA56_ADDR   },\
	{E2_DATA57_ADDR   },\
	{E2_DATA58_ADDR   },\
	{E2_DATA59_ADDR   },\
	{E2_DATA60_ADDR   },\
	{E2_DATA61_ADDR   },\
	{E2_DATA62_ADDR   },\
	{E2_DATA63_ADDR   },

#else
    #error "MAC NUM_OF_E2_ID is NOT defined !"    /* NUM_OF_E2_ID Defines not found! */   
    
#endif //#if (NUM_OF_E2_ID == NUM_OF_E2_64_ID)

/*****************************************************************************/
/**
* Function Name: E2_DATA_TABLE
* Description: {e2_request, e2_status, e2_length, read_e2_memcpy_ptr, read_e2_backup_memcpy_ptr, write_e2_memcpy_ptr, write_e2_backup_memcpy_ptr},this table is 
* not const table. 
*
* Param:   
*          
* Author:  
******************************************************************************/
#if (NUM_OF_E2_ID == NUM_OF_E2_32_ID)

#define E2_DATA_TABLE       \
/*0_*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*1_*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*2_*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*3_*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*4_*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*5_*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*6_*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*7_*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*8_*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*9_*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*10*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*11*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*12*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*13*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*14*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*15*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*16*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*17*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*18*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*19*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*20*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*21*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*22*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*23*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*24*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*25*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*26*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*27*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*28*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*29*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*30*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*31*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, 

#elif (NUM_OF_E2_ID == NUM_OF_E2_64_ID)   

#define E2_DATA_TABLE       \
/*0_*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*1_*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*2_*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*3_*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*4_*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*5_*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*6_*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*7_*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*8_*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*9_*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*10*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*11*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*12*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*13*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*14*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*15*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*16*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*17*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*18*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*19*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*20*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*21*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*22*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*23*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*24*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*25*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*26*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*27*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*28*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*29*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*30*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*31*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*32*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*33*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*34*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*35*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*36*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*37*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*38*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*39*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*40*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*41*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*42*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*43*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*44*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*45*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*46*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*47*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*48*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*49*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*50*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*51*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*52*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*53*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*54*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*55*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*56*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*57*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*58*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*59*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*60*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*61*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*62*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, \
/*63*/ {E2_REQUEST_IDLE, E2_STATUS_IDLE}, 

#else
    #error "MAC NUM_OF_E2_ID is NOT defined !"    /* NUM_OF_E2_ID Defines not found! */   
    
#endif //#if (NUM_OF_E2_ID == NUM_OF_E2_64_ID)


#if (NUM_OF_E2_ID == NUM_OF_E2_32_ID)

#define E2_DATA_CONST_TABLE       \
{  &g_u32_write_e2_data[0], &g_u32_write_lrc_e2_data[0], &g_u32_write_e2_backup_data[0], &g_u32_write_lrc_e2_backup_data[0]},\
{  &g_u32_write_e2_data[1], &g_u32_write_lrc_e2_data[1], &g_u32_write_e2_backup_data[1], &g_u32_write_lrc_e2_backup_data[1]},\
{  &g_u32_write_e2_data[2], &g_u32_write_lrc_e2_data[2], &g_u32_write_e2_backup_data[2], &g_u32_write_lrc_e2_backup_data[2]},\
{  &g_u32_write_e2_data[3], &g_u32_write_lrc_e2_data[3], &g_u32_write_e2_backup_data[3], &g_u32_write_lrc_e2_backup_data[3]},\
{  &g_u32_write_e2_data[4], &g_u32_write_lrc_e2_data[4], &g_u32_write_e2_backup_data[4], &g_u32_write_lrc_e2_backup_data[4]},\
{  &g_u32_write_e2_data[5], &g_u32_write_lrc_e2_data[5], &g_u32_write_e2_backup_data[5], &g_u32_write_lrc_e2_backup_data[5]},\
{  &g_u32_write_e2_data[6], &g_u32_write_lrc_e2_data[6], &g_u32_write_e2_backup_data[6], &g_u32_write_lrc_e2_backup_data[6]},\
{  &g_u32_write_e2_data[7], &g_u32_write_lrc_e2_data[7], &g_u32_write_e2_backup_data[7], &g_u32_write_lrc_e2_backup_data[7]},\
{  &g_u32_write_e2_data[8], &g_u32_write_lrc_e2_data[8], &g_u32_write_e2_backup_data[8], &g_u32_write_lrc_e2_backup_data[8]},\
{  &g_u32_write_e2_data[9], &g_u32_write_lrc_e2_data[9], &g_u32_write_e2_backup_data[9], &g_u32_write_lrc_e2_backup_data[9]},\
{  &g_u32_write_e2_data[10], &g_u32_write_lrc_e2_data[10], &g_u32_write_e2_backup_data[10], &g_u32_write_lrc_e2_backup_data[10]},\
{  &g_u32_write_e2_data[11], &g_u32_write_lrc_e2_data[11], &g_u32_write_e2_backup_data[11], &g_u32_write_lrc_e2_backup_data[11]},\
{  &g_u32_write_e2_data[12], &g_u32_write_lrc_e2_data[12], &g_u32_write_e2_backup_data[12], &g_u32_write_lrc_e2_backup_data[12]},\
{  &g_u32_write_e2_data[13], &g_u32_write_lrc_e2_data[13], &g_u32_write_e2_backup_data[13], &g_u32_write_lrc_e2_backup_data[13]},\
{  &g_u32_write_e2_data[14], &g_u32_write_lrc_e2_data[14], &g_u32_write_e2_backup_data[14], &g_u32_write_lrc_e2_backup_data[14]},\
{  &g_u32_write_e2_data[15], &g_u32_write_lrc_e2_data[15], &g_u32_write_e2_backup_data[15], &g_u32_write_lrc_e2_backup_data[15]},\
{  &g_u32_write_e2_data[16], &g_u32_write_lrc_e2_data[16], &g_u32_write_e2_backup_data[16], &g_u32_write_lrc_e2_backup_data[16]},\
{  &g_u32_write_e2_data[17], &g_u32_write_lrc_e2_data[17], &g_u32_write_e2_backup_data[17], &g_u32_write_lrc_e2_backup_data[17]},\
{  &g_u32_write_e2_data[18], &g_u32_write_lrc_e2_data[18], &g_u32_write_e2_backup_data[18], &g_u32_write_lrc_e2_backup_data[18]},\
{  &g_u32_write_e2_data[19], &g_u32_write_lrc_e2_data[19], &g_u32_write_e2_backup_data[19], &g_u32_write_lrc_e2_backup_data[19]},\
{  &g_u32_write_e2_data[20], &g_u32_write_lrc_e2_data[20], &g_u32_write_e2_backup_data[20], &g_u32_write_lrc_e2_backup_data[20]},\
{  &g_u32_write_e2_data[21], &g_u32_write_lrc_e2_data[21], &g_u32_write_e2_backup_data[21], &g_u32_write_lrc_e2_backup_data[21]},\
{  &g_u32_write_e2_data[22], &g_u32_write_lrc_e2_data[22], &g_u32_write_e2_backup_data[22], &g_u32_write_lrc_e2_backup_data[22]},\
{  &g_u32_write_e2_data[23], &g_u32_write_lrc_e2_data[23], &g_u32_write_e2_backup_data[23], &g_u32_write_lrc_e2_backup_data[23]},\
{  &g_u32_write_e2_data[24], &g_u32_write_lrc_e2_data[24], &g_u32_write_e2_backup_data[24], &g_u32_write_lrc_e2_backup_data[24]},\
{  &g_u32_write_e2_data[25], &g_u32_write_lrc_e2_data[25], &g_u32_write_e2_backup_data[25], &g_u32_write_lrc_e2_backup_data[25]},\
{  &g_u32_write_e2_data[26], &g_u32_write_lrc_e2_data[26], &g_u32_write_e2_backup_data[26], &g_u32_write_lrc_e2_backup_data[26]},\
{  &g_u32_write_e2_data[27], &g_u32_write_lrc_e2_data[27], &g_u32_write_e2_backup_data[27], &g_u32_write_lrc_e2_backup_data[27]},\
{  &g_u32_write_e2_data[28], &g_u32_write_lrc_e2_data[28], &g_u32_write_e2_backup_data[28], &g_u32_write_lrc_e2_backup_data[28]},\
{  &g_u32_write_e2_data[29], &g_u32_write_lrc_e2_data[29], &g_u32_write_e2_backup_data[29], &g_u32_write_lrc_e2_backup_data[29]},\
{  &g_u32_write_e2_data[30], &g_u32_write_lrc_e2_data[30], &g_u32_write_e2_backup_data[30], &g_u32_write_lrc_e2_backup_data[30]},\
{  &g_u32_write_e2_data[31], &g_u32_write_lrc_e2_data[31], &g_u32_write_e2_backup_data[31], &g_u32_write_lrc_e2_backup_data[31]},

#elif (NUM_OF_E2_ID == NUM_OF_E2_64_ID)  

#define E2_DATA_CONST_TABLE       \
{  &g_u32_write_e2_data[0], &g_u32_write_lrc_e2_data[0], &g_u32_write_e2_backup_data[0], &g_u32_write_lrc_e2_backup_data[0]},\
{  &g_u32_write_e2_data[1], &g_u32_write_lrc_e2_data[1], &g_u32_write_e2_backup_data[1], &g_u32_write_lrc_e2_backup_data[1]},\
{  &g_u32_write_e2_data[2], &g_u32_write_lrc_e2_data[2], &g_u32_write_e2_backup_data[2], &g_u32_write_lrc_e2_backup_data[2]},\
{  &g_u32_write_e2_data[3], &g_u32_write_lrc_e2_data[3], &g_u32_write_e2_backup_data[3], &g_u32_write_lrc_e2_backup_data[3]},\
{  &g_u32_write_e2_data[4], &g_u32_write_lrc_e2_data[4], &g_u32_write_e2_backup_data[4], &g_u32_write_lrc_e2_backup_data[4]},\
{  &g_u32_write_e2_data[5], &g_u32_write_lrc_e2_data[5], &g_u32_write_e2_backup_data[5], &g_u32_write_lrc_e2_backup_data[5]},\
{  &g_u32_write_e2_data[6], &g_u32_write_lrc_e2_data[6], &g_u32_write_e2_backup_data[6], &g_u32_write_lrc_e2_backup_data[6]},\
{  &g_u32_write_e2_data[7], &g_u32_write_lrc_e2_data[7], &g_u32_write_e2_backup_data[7], &g_u32_write_lrc_e2_backup_data[7]},\
{  &g_u32_write_e2_data[8], &g_u32_write_lrc_e2_data[8], &g_u32_write_e2_backup_data[8], &g_u32_write_lrc_e2_backup_data[8]},\
{  &g_u32_write_e2_data[9], &g_u32_write_lrc_e2_data[9], &g_u32_write_e2_backup_data[9], &g_u32_write_lrc_e2_backup_data[9]},\
{  &g_u32_write_e2_data[10], &g_u32_write_lrc_e2_data[10], &g_u32_write_e2_backup_data[10], &g_u32_write_lrc_e2_backup_data[10]},\
{  &g_u32_write_e2_data[11], &g_u32_write_lrc_e2_data[11], &g_u32_write_e2_backup_data[11], &g_u32_write_lrc_e2_backup_data[11]},\
{  &g_u32_write_e2_data[12], &g_u32_write_lrc_e2_data[12], &g_u32_write_e2_backup_data[12], &g_u32_write_lrc_e2_backup_data[12]},\
{  &g_u32_write_e2_data[13], &g_u32_write_lrc_e2_data[13], &g_u32_write_e2_backup_data[13], &g_u32_write_lrc_e2_backup_data[13]},\
{  &g_u32_write_e2_data[14], &g_u32_write_lrc_e2_data[14], &g_u32_write_e2_backup_data[14], &g_u32_write_lrc_e2_backup_data[14]},\
{  &g_u32_write_e2_data[15], &g_u32_write_lrc_e2_data[15], &g_u32_write_e2_backup_data[15], &g_u32_write_lrc_e2_backup_data[15]},\
{  &g_u32_write_e2_data[16], &g_u32_write_lrc_e2_data[16], &g_u32_write_e2_backup_data[16], &g_u32_write_lrc_e2_backup_data[16]},\
{  &g_u32_write_e2_data[17], &g_u32_write_lrc_e2_data[17], &g_u32_write_e2_backup_data[17], &g_u32_write_lrc_e2_backup_data[17]},\
{  &g_u32_write_e2_data[18], &g_u32_write_lrc_e2_data[18], &g_u32_write_e2_backup_data[18], &g_u32_write_lrc_e2_backup_data[18]},\
{  &g_u32_write_e2_data[19], &g_u32_write_lrc_e2_data[19], &g_u32_write_e2_backup_data[19], &g_u32_write_lrc_e2_backup_data[19]},\
{  &g_u32_write_e2_data[20], &g_u32_write_lrc_e2_data[20], &g_u32_write_e2_backup_data[20], &g_u32_write_lrc_e2_backup_data[20]},\
{  &g_u32_write_e2_data[21], &g_u32_write_lrc_e2_data[21], &g_u32_write_e2_backup_data[21], &g_u32_write_lrc_e2_backup_data[21]},\
{  &g_u32_write_e2_data[22], &g_u32_write_lrc_e2_data[22], &g_u32_write_e2_backup_data[22], &g_u32_write_lrc_e2_backup_data[22]},\
{  &g_u32_write_e2_data[23], &g_u32_write_lrc_e2_data[23], &g_u32_write_e2_backup_data[23], &g_u32_write_lrc_e2_backup_data[23]},\
{  &g_u32_write_e2_data[24], &g_u32_write_lrc_e2_data[24], &g_u32_write_e2_backup_data[24], &g_u32_write_lrc_e2_backup_data[24]},\
{  &g_u32_write_e2_data[25], &g_u32_write_lrc_e2_data[25], &g_u32_write_e2_backup_data[25], &g_u32_write_lrc_e2_backup_data[25]},\
{  &g_u32_write_e2_data[26], &g_u32_write_lrc_e2_data[26], &g_u32_write_e2_backup_data[26], &g_u32_write_lrc_e2_backup_data[26]},\
{  &g_u32_write_e2_data[27], &g_u32_write_lrc_e2_data[27], &g_u32_write_e2_backup_data[27], &g_u32_write_lrc_e2_backup_data[27]},\
{  &g_u32_write_e2_data[28], &g_u32_write_lrc_e2_data[28], &g_u32_write_e2_backup_data[28], &g_u32_write_lrc_e2_backup_data[28]},\
{  &g_u32_write_e2_data[29], &g_u32_write_lrc_e2_data[29], &g_u32_write_e2_backup_data[29], &g_u32_write_lrc_e2_backup_data[29]},\
{  &g_u32_write_e2_data[30], &g_u32_write_lrc_e2_data[30], &g_u32_write_e2_backup_data[30], &g_u32_write_lrc_e2_backup_data[30]},\
{  &g_u32_write_e2_data[31], &g_u32_write_lrc_e2_data[31], &g_u32_write_e2_backup_data[31], &g_u32_write_lrc_e2_backup_data[31]},\
{  &g_u32_write_e2_data[32], &g_u32_write_lrc_e2_data[32], &g_u32_write_e2_backup_data[32], &g_u32_write_lrc_e2_backup_data[32]},\
{  &g_u32_write_e2_data[33], &g_u32_write_lrc_e2_data[33], &g_u32_write_e2_backup_data[33], &g_u32_write_lrc_e2_backup_data[33]},\
{  &g_u32_write_e2_data[34], &g_u32_write_lrc_e2_data[34], &g_u32_write_e2_backup_data[34], &g_u32_write_lrc_e2_backup_data[34]},\
{  &g_u32_write_e2_data[35], &g_u32_write_lrc_e2_data[35], &g_u32_write_e2_backup_data[35], &g_u32_write_lrc_e2_backup_data[35]},\
{  &g_u32_write_e2_data[36], &g_u32_write_lrc_e2_data[36], &g_u32_write_e2_backup_data[36], &g_u32_write_lrc_e2_backup_data[36]},\
{  &g_u32_write_e2_data[37], &g_u32_write_lrc_e2_data[37], &g_u32_write_e2_backup_data[37], &g_u32_write_lrc_e2_backup_data[37]},\
{  &g_u32_write_e2_data[38], &g_u32_write_lrc_e2_data[38], &g_u32_write_e2_backup_data[38], &g_u32_write_lrc_e2_backup_data[38]},\
{  &g_u32_write_e2_data[39], &g_u32_write_lrc_e2_data[39], &g_u32_write_e2_backup_data[39], &g_u32_write_lrc_e2_backup_data[39]},\
{  &g_u32_write_e2_data[40], &g_u32_write_lrc_e2_data[40], &g_u32_write_e2_backup_data[40], &g_u32_write_lrc_e2_backup_data[40]},\
{  &g_u32_write_e2_data[41], &g_u32_write_lrc_e2_data[41], &g_u32_write_e2_backup_data[41], &g_u32_write_lrc_e2_backup_data[41]},\
{  &g_u32_write_e2_data[42], &g_u32_write_lrc_e2_data[42], &g_u32_write_e2_backup_data[42], &g_u32_write_lrc_e2_backup_data[42]},\
{  &g_u32_write_e2_data[43], &g_u32_write_lrc_e2_data[43], &g_u32_write_e2_backup_data[43], &g_u32_write_lrc_e2_backup_data[43]},\
{  &g_u32_write_e2_data[44], &g_u32_write_lrc_e2_data[44], &g_u32_write_e2_backup_data[44], &g_u32_write_lrc_e2_backup_data[44]},\
{  &g_u32_write_e2_data[45], &g_u32_write_lrc_e2_data[45], &g_u32_write_e2_backup_data[45], &g_u32_write_lrc_e2_backup_data[45]},\
{  &g_u32_write_e2_data[46], &g_u32_write_lrc_e2_data[46], &g_u32_write_e2_backup_data[46], &g_u32_write_lrc_e2_backup_data[46]},\
{  &g_u32_write_e2_data[47], &g_u32_write_lrc_e2_data[47], &g_u32_write_e2_backup_data[47], &g_u32_write_lrc_e2_backup_data[47]},\
{  &g_u32_write_e2_data[48], &g_u32_write_lrc_e2_data[48], &g_u32_write_e2_backup_data[48], &g_u32_write_lrc_e2_backup_data[48]},\
{  &g_u32_write_e2_data[49], &g_u32_write_lrc_e2_data[49], &g_u32_write_e2_backup_data[49], &g_u32_write_lrc_e2_backup_data[49]},\
{  &g_u32_write_e2_data[50], &g_u32_write_lrc_e2_data[50], &g_u32_write_e2_backup_data[50], &g_u32_write_lrc_e2_backup_data[50]},\
{  &g_u32_write_e2_data[51], &g_u32_write_lrc_e2_data[51], &g_u32_write_e2_backup_data[51], &g_u32_write_lrc_e2_backup_data[51]},\
{  &g_u32_write_e2_data[52], &g_u32_write_lrc_e2_data[52], &g_u32_write_e2_backup_data[52], &g_u32_write_lrc_e2_backup_data[52]},\
{  &g_u32_write_e2_data[53], &g_u32_write_lrc_e2_data[53], &g_u32_write_e2_backup_data[53], &g_u32_write_lrc_e2_backup_data[53]},\
{  &g_u32_write_e2_data[54], &g_u32_write_lrc_e2_data[54], &g_u32_write_e2_backup_data[54], &g_u32_write_lrc_e2_backup_data[54]},\
{  &g_u32_write_e2_data[55], &g_u32_write_lrc_e2_data[55], &g_u32_write_e2_backup_data[55], &g_u32_write_lrc_e2_backup_data[55]},\
{  &g_u32_write_e2_data[56], &g_u32_write_lrc_e2_data[56], &g_u32_write_e2_backup_data[56], &g_u32_write_lrc_e2_backup_data[56]},\
{  &g_u32_write_e2_data[57], &g_u32_write_lrc_e2_data[57], &g_u32_write_e2_backup_data[57], &g_u32_write_lrc_e2_backup_data[57]},\
{  &g_u32_write_e2_data[58], &g_u32_write_lrc_e2_data[58], &g_u32_write_e2_backup_data[58], &g_u32_write_lrc_e2_backup_data[58]},\
{  &g_u32_write_e2_data[59], &g_u32_write_lrc_e2_data[59], &g_u32_write_e2_backup_data[59], &g_u32_write_lrc_e2_backup_data[59]},\
{  &g_u32_write_e2_data[60], &g_u32_write_lrc_e2_data[60], &g_u32_write_e2_backup_data[60], &g_u32_write_lrc_e2_backup_data[60]},\
{  &g_u32_write_e2_data[61], &g_u32_write_lrc_e2_data[61], &g_u32_write_e2_backup_data[61], &g_u32_write_lrc_e2_backup_data[61]},\
{  &g_u32_write_e2_data[62], &g_u32_write_lrc_e2_data[62], &g_u32_write_e2_backup_data[62], &g_u32_write_lrc_e2_backup_data[62]},\
{  &g_u32_write_e2_data[63], &g_u32_write_lrc_e2_data[63], &g_u32_write_e2_backup_data[63], &g_u32_write_lrc_e2_backup_data[63]}

#else
    #error "MAC NUM_OF_E2_ID is NOT defined !"    /* NUM_OF_E2_ID Defines not found! */   
    
#endif //#if (NUM_OF_E2_ID == NUM_OF_E2_64_ID)


/* typedef */

/* Variables */  

#if (MCU_E2PROM_TYPE == MCU_E2PROM_S12G48)

    #define E2_BACKUP_DATA_BASE_ADDR	((UINT16)0x300)

#elif (MCU_E2PROM_TYPE == MCU_E2PROM_S12G64)

    #define E2_BACKUP_DATA_BASE_ADDR	((UINT16)0x400)

#elif (MCU_E2PROM_TYPE == MCU_E2PROM_S12G128)

    #define E2_BACKUP_DATA_BASE_ADDR	((UINT16)0x800)

#elif (MCU_E2PROM_TYPE == MCU_E2PROM_S12G192)

    #define E2_BACKUP_DATA_BASE_ADDR	((UINT16)0x800)

#else
    #error "MAC MCU_E2PROM_TYPE is NOT defined !"    /* MCU_E2PROM_TYPE Defines not found! */   
#endif 


#define E2_BACKUP_DATA0_ADDR		((UINT16)(E2_BACKUP_DATA_BASE_ADDR +  0*8))
#define E2_BACKUP_DATA1_ADDR		((UINT16)(E2_BACKUP_DATA_BASE_ADDR +  1*8))
#define E2_BACKUP_DATA2_ADDR		((UINT16)(E2_BACKUP_DATA_BASE_ADDR +  2*8))
#define E2_BACKUP_DATA3_ADDR	   	((UINT16)(E2_BACKUP_DATA_BASE_ADDR +  3*8))
#define E2_BACKUP_DATA4_ADDR		((UINT16)(E2_BACKUP_DATA_BASE_ADDR +  4*8))
#define E2_BACKUP_DATA5_ADDR		((UINT16)(E2_BACKUP_DATA_BASE_ADDR +  5*8))
#define E2_BACKUP_DATA6_ADDR		((UINT16)(E2_BACKUP_DATA_BASE_ADDR +  6*8))
#define E2_BACKUP_DATA7_ADDR		((UINT16)(E2_BACKUP_DATA_BASE_ADDR +  7*8))
#define E2_BACKUP_DATA8_ADDR		((UINT16)(E2_BACKUP_DATA_BASE_ADDR +  8*8))
#define E2_BACKUP_DATA9_ADDR	 	((UINT16)(E2_BACKUP_DATA_BASE_ADDR +  9*8))
#define E2_BACKUP_DATA10_ADDR	 	((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 10*8))
#define E2_BACKUP_DATA11_ADDR	 	((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 11*8))
#define E2_BACKUP_DATA12_ADDR	 	((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 12*8))
#define E2_BACKUP_DATA13_ADDR	 	((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 13*8))
#define E2_BACKUP_DATA14_ADDR	 	((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 14*8))
#define E2_BACKUP_DATA15_ADDR	 	((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 15*8))
#define E2_BACKUP_DATA16_ADDR	 	((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 16*8))
#define E2_BACKUP_DATA17_ADDR	 	((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 17*8))
#define E2_BACKUP_DATA18_ADDR	 	((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 18*8))
#define E2_BACKUP_DATA19_ADDR	 	((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 19*8))
#define E2_BACKUP_DATA20_ADDR	 	((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 20*8))
#define E2_BACKUP_DATA21_ADDR	 	((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 21*8))
#define E2_BACKUP_DATA22_ADDR	 	((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 22*8))
#define E2_BACKUP_DATA23_ADDR	 	((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 23*8))
#define E2_BACKUP_DATA24_ADDR	 	((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 24*8))
#define E2_BACKUP_DATA25_ADDR	 	((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 25*8))
#define E2_BACKUP_DATA26_ADDR	 	((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 26*8))
#define E2_BACKUP_DATA27_ADDR	 	((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 27*8))
#define E2_BACKUP_DATA28_ADDR	 	((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 28*8))
#define E2_BACKUP_DATA29_ADDR	 	((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 29*8))
#define E2_BACKUP_DATA30_ADDR	 	((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 30*8))
#define E2_BACKUP_DATA31_ADDR	 	((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 31*8))

#if (NUM_OF_E2_ID == NUM_OF_E2_64_ID)
#define E2_BACKUP_DATA32_ADDR		((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 32*8))
#define E2_BACKUP_DATA33_ADDR		((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 33*8))
#define E2_BACKUP_DATA34_ADDR		((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 34*8))
#define E2_BACKUP_DATA35_ADDR	   	((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 35*8))
#define E2_BACKUP_DATA36_ADDR		((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 36*8))
#define E2_BACKUP_DATA37_ADDR		((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 37*8))
#define E2_BACKUP_DATA38_ADDR		((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 38*8))
#define E2_BACKUP_DATA39_ADDR		((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 39*8))
#define E2_BACKUP_DATA40_ADDR		((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 40*8))
#define E2_BACKUP_DATA41_ADDR	 	((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 41*8))
#define E2_BACKUP_DATA42_ADDR	 	((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 42*8))
#define E2_BACKUP_DATA43_ADDR	 	((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 43*8))
#define E2_BACKUP_DATA44_ADDR	 	((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 44*8))
#define E2_BACKUP_DATA45_ADDR	 	((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 45*8))
#define E2_BACKUP_DATA46_ADDR	 	((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 46*8))
#define E2_BACKUP_DATA47_ADDR	 	((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 47*8))
#define E2_BACKUP_DATA48_ADDR	 	((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 48*8))
#define E2_BACKUP_DATA49_ADDR	 	((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 49*8))
#define E2_BACKUP_DATA50_ADDR	 	((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 50*8))
#define E2_BACKUP_DATA51_ADDR	 	((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 51*8))
#define E2_BACKUP_DATA52_ADDR	 	((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 52*8))
#define E2_BACKUP_DATA53_ADDR	 	((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 53*8))
#define E2_BACKUP_DATA54_ADDR	 	((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 54*8))
#define E2_BACKUP_DATA55_ADDR	 	((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 55*8))
#define E2_BACKUP_DATA56_ADDR	 	((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 56*8))
#define E2_BACKUP_DATA57_ADDR	 	((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 57*8))
#define E2_BACKUP_DATA58_ADDR	 	((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 58*8))
#define E2_BACKUP_DATA59_ADDR	 	((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 59*8))
#define E2_BACKUP_DATA60_ADDR	 	((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 60*8))
#define E2_BACKUP_DATA61_ADDR	 	((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 61*8))
#define E2_BACKUP_DATA62_ADDR	 	((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 62*8))
#define E2_BACKUP_DATA63_ADDR	 	((UINT16)(E2_BACKUP_DATA_BASE_ADDR + 63*8))

#endif//#if (NUM_OF_E2_ID == NUM_OF_E2_64_ID)


#if (NUM_OF_E2_ID == NUM_OF_E2_32_ID)
#define EE_BACKUP_MAP_TABLE   \
   {E2_BACKUP_DATA0_ADDR    },\
   {E2_BACKUP_DATA1_ADDR    },\
   {E2_BACKUP_DATA2_ADDR    },\
   {E2_BACKUP_DATA3_ADDR    },\
   {E2_BACKUP_DATA4_ADDR    },\
   {E2_BACKUP_DATA5_ADDR    },\
   {E2_BACKUP_DATA6_ADDR    },\
   {E2_BACKUP_DATA7_ADDR    },\
   {E2_BACKUP_DATA8_ADDR    },\
   {E2_BACKUP_DATA9_ADDR    },\
   {E2_BACKUP_DATA10_ADDR   },\
   {E2_BACKUP_DATA11_ADDR   },\
   {E2_BACKUP_DATA12_ADDR   },\
   {E2_BACKUP_DATA13_ADDR   },\
   {E2_BACKUP_DATA14_ADDR   },\
   {E2_BACKUP_DATA15_ADDR   },\
   {E2_BACKUP_DATA16_ADDR   },\
   {E2_BACKUP_DATA17_ADDR   },\
   {E2_BACKUP_DATA18_ADDR   },\
   {E2_BACKUP_DATA19_ADDR   },\
   {E2_BACKUP_DATA20_ADDR   },\
   {E2_BACKUP_DATA21_ADDR   },\
   {E2_BACKUP_DATA22_ADDR   },\
   {E2_BACKUP_DATA23_ADDR   },\
   {E2_BACKUP_DATA24_ADDR   },\
   {E2_BACKUP_DATA25_ADDR   },\
   {E2_BACKUP_DATA26_ADDR   },\
   {E2_BACKUP_DATA27_ADDR   },\
   {E2_BACKUP_DATA28_ADDR   },\
   {E2_BACKUP_DATA29_ADDR   },\
   {E2_BACKUP_DATA30_ADDR   },\
   {E2_BACKUP_DATA31_ADDR   },

#elif (NUM_OF_E2_ID == NUM_OF_E2_64_ID)  

#define EE_BACKUP_MAP_TABLE   \
   {E2_BACKUP_DATA0_ADDR    },\
   {E2_BACKUP_DATA1_ADDR    },\
   {E2_BACKUP_DATA2_ADDR    },\
   {E2_BACKUP_DATA3_ADDR    },\
   {E2_BACKUP_DATA4_ADDR    },\
   {E2_BACKUP_DATA5_ADDR    },\
   {E2_BACKUP_DATA6_ADDR    },\
   {E2_BACKUP_DATA7_ADDR    },\
   {E2_BACKUP_DATA8_ADDR    },\
   {E2_BACKUP_DATA9_ADDR    },\
   {E2_BACKUP_DATA10_ADDR   },\
   {E2_BACKUP_DATA11_ADDR   },\
   {E2_BACKUP_DATA12_ADDR   },\
   {E2_BACKUP_DATA13_ADDR   },\
   {E2_BACKUP_DATA14_ADDR   },\
   {E2_BACKUP_DATA15_ADDR   },\
   {E2_BACKUP_DATA16_ADDR   },\
   {E2_BACKUP_DATA17_ADDR   },\
   {E2_BACKUP_DATA18_ADDR   },\
   {E2_BACKUP_DATA19_ADDR   },\
   {E2_BACKUP_DATA20_ADDR   },\
   {E2_BACKUP_DATA21_ADDR   },\
   {E2_BACKUP_DATA22_ADDR   },\
   {E2_BACKUP_DATA23_ADDR   },\
   {E2_BACKUP_DATA24_ADDR   },\
   {E2_BACKUP_DATA25_ADDR   },\
   {E2_BACKUP_DATA26_ADDR   },\
   {E2_BACKUP_DATA27_ADDR   },\
   {E2_BACKUP_DATA28_ADDR   },\
   {E2_BACKUP_DATA29_ADDR   },\
   {E2_BACKUP_DATA30_ADDR   },\
   {E2_BACKUP_DATA31_ADDR   },\
   {E2_BACKUP_DATA32_ADDR   },\
   {E2_BACKUP_DATA33_ADDR   },\
   {E2_BACKUP_DATA34_ADDR   },\
   {E2_BACKUP_DATA35_ADDR   },\
   {E2_BACKUP_DATA36_ADDR   },\
   {E2_BACKUP_DATA37_ADDR   },\
   {E2_BACKUP_DATA38_ADDR   },\
   {E2_BACKUP_DATA39_ADDR   },\
   {E2_BACKUP_DATA40_ADDR   },\
   {E2_BACKUP_DATA41_ADDR   },\
   {E2_BACKUP_DATA42_ADDR   },\
   {E2_BACKUP_DATA43_ADDR   },\
   {E2_BACKUP_DATA44_ADDR   },\
   {E2_BACKUP_DATA45_ADDR   },\
   {E2_BACKUP_DATA46_ADDR   },\
   {E2_BACKUP_DATA47_ADDR   },\
   {E2_BACKUP_DATA48_ADDR   },\
   {E2_BACKUP_DATA49_ADDR   },\
   {E2_BACKUP_DATA50_ADDR   },\
   {E2_BACKUP_DATA51_ADDR   },\
   {E2_BACKUP_DATA52_ADDR   },\
   {E2_BACKUP_DATA53_ADDR   },\
   {E2_BACKUP_DATA54_ADDR   },\
   {E2_BACKUP_DATA55_ADDR   },\
   {E2_BACKUP_DATA56_ADDR   },\
   {E2_BACKUP_DATA57_ADDR   },\
   {E2_BACKUP_DATA58_ADDR   },\
   {E2_BACKUP_DATA59_ADDR   },\
   {E2_BACKUP_DATA60_ADDR   },\
   {E2_BACKUP_DATA61_ADDR   },\
   {E2_BACKUP_DATA62_ADDR   },\
   {E2_BACKUP_DATA63_ADDR   }

#else
    #error "MAC NUM_OF_E2_ID is NOT defined !"    /* NUM_OF_E2_ID Defines not found! */   
    
#endif //#if (NUM_OF_E2_ID == NUM_OF_E2_64_ID)


/***********************end of hwa_e2_cfg.h***********************************/
#endif

